<?php


namespace app\mini\controller\v1\shop;

use app\common\logic\RechargeLogic;
use app\common\logic\ShopLogic;
use app\mini\controller\Common;
use app\mini\controller\v1\shop\validate\shopValidate;
use think\Request;
use think\response\Json;

class Shop extends Common
{
    public $ShopLogic;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->ShopLogic = new ShopLogic();
    }

    /**
     * 商家信息
     * @return Json
     */
    public function info(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopLogic->shopInfo();
        });
        return $this->response($res);
    }

    /**
     * 更新营业时间
     * @return Json
     */
    public function editBusinessTime(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopLogic->editBusinessTime(request()->param());
        });
        return $this->response($res);
    }

    /**
     * 店铺标签列表
     * @return Json
     */
    public function tagList(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopLogic->tagList();
        });
        return $this->response($res);
    }

    /**
     * 保存商家标签
     * @return Json
     */
    public function saveTags(): Json
    {
        $res = $this->exception(function () {
            return $this->ShopLogic->saveTags(request()->param());
        });
        return $this->response($res);
    }
}